package com.itheima.d5_arrays;

import java.util.Arrays;
import java.util.function.IntToDoubleFunction;

public class ArraysTest1 {
    public static void main(String[] args) {
        int[] arr={1,2,3};
        System.out.println(Arrays.toString(arr));

        int[] arr2 = Arrays.copyOfRange(arr,0,1);//包前不包后
        System.out.println(Arrays.toString(arr2));

        int[] arr3 = Arrays.copyOf(arr, 3);
        System.out.println(Arrays.toString(arr3));

        double[] price ={1.2,3.4,5.6};

        Arrays.setAll(price, new IntToDoubleFunction() {
            @Override
            public double applyAsDouble(int value) {
                return price[value] * 100;
            }
        });
        System.out.println(Arrays.toString(price));

        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));

    }
}
